<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="../node_modules/@vue/runtime-dom/dist/runtime-dom.global.js"></script>
    <div id="app"></div>
    <script>
        let {
            createApp,
            h,
            ref
        } = VueRuntimeDOM;
        let App = {
            props: {
                name: String
            },
            setup(props, context) {
                const isFlag = ref(true);
                setTimeout(() => {
                    isFlag.value = false
                }, 3000)
                return () => {
                    return isFlag ? h('div', {
                        style: {
                            color: 'red'
                        }
                    }, `hello world`) : h('span', {
                        style: {
                            color: 'pink'
                        }
                    }, `12222`)
                }
            }
        }
        // 参数 1 组件以哪个组件作为入口 ， 2 props
        createApp(App, {
            name: 'aa'
        }).mount('#app')
    </script>
</body>

</html>